\section{The Evaltrace Style}

In order to promote the use of evaltrace notation (see {\sl
Visualizing Evaluation in Applicative Languages}, by David S.
Touretzky and Peter Lee, Carnegie Mellon Technical Report
CMU-CS-89-198-R, Pittsburgh, 1989), a formatting style and font for use
with \LaTeX\ have been made available.  These are available via
anonymous ftp in compressed tar format, from {\tt a.ergo.cs.cmu.edu}
(128.2.250.219), in directory {\tt pub/evaltrace}, files {\tt README}
and {\tt evaltrace.tar.Z}.

The creators of the style and font are {\em not\/} ``wizards'' at
\TeX\ or \metafont.  As a result, the style and font definition files
have been quickly hacked together.  Any improvements that you might
make would be greatly appreciated.  Please send them by email to
either {\tt Peter.Lee@cs.cmu.edu}.  We'll try to keep the distribution
up-to-date.

\subsection{Loading the evaltrace style}

The distribution contains several subdirectories which contain \TeX\
style files, \metafont\ files, and various kinds of font information.
These should all be installed into the appropriate places on your
computer system.  Ask your local system administrator or \TeX\
maintainer if you are not able to do this yourself.

Once things have been installed properly, you will be able to use the
evaltrace style by specifying the ``evaltrace'' option in the
documentstyle command.  For example, the documentstyle command for
this document goes as follows:

\begin{verbatim}
    \documentstyle[12pt,fullpage,evaltrace,code]{article}
\end{verbatim}

The ``code'' option isn't really a part of the evaltrace style, but is
often useful in documents that use evaltrace.  Thanks should go to Jon
Rees at MIT for providing us with the code style.

\subsection{Using the evaltrace style}

Basically, the evaltrace and code options define new environments
(called evaltrace and code) which behave much like verbatim, except
that certain characters and character sequences are interpreted in a
special way.  The code environment is almost exactly like verbatim
(\ie, spaces and line breaks are respected, and characters are set in
teletype font), except that the backslash (``\verb|\|'') and dollar-sign
(``\$'') characters are still interpreted specially.  So, for example,
the following input:
\small
\begin{verbatim}
    \begin{code}
    {\bf procedure} foo ({\bf var} x: integer);
      {\bf begin}
          x := $\sum{\tt a}_{i}$
      {\bf end}l
    \end{code}
\end{verbatim}
\normalsize
produces the following output:
\begin{code}
{\bf procedure} foo ({\bf var} x: integer);
  {\bf begin}
      x := $\sum{\tt a}_{i}$
  {\bf end};
\end{code}
 This environment will also ensure that no page breaks occur in the
middle of the output.  For multi-page code output, the ``bigcode''
environment should be used instead of ``code.''

The evaltrace style loads a special fixed-width font called ``et,''
which has the special characters for drawing evaltrace diagrams.  In
the et font, various ASCII characters are mapped to et characters, for
example, saying \verb'{\et -}' produces the evaltrace horizontal thin
rule, {\et -}, \verb'{\et >}' produces {\et >}, and \verb'{\et -->}'
produces {\et -->}.  Section~\ref{font} gives a complete listing of
the et font.  This font makes it possible to draw simple evaltrace
diagrams in the code environment, as in the following:
\small
\begin{verbatim}
    \begin{code}
    (+ 2 3) {\et -->} 5
    \end{code}
\end{verbatim}
\normalsize
 which results in
\begin{code}
(+ 2 3) {\et -->} 5
\end{code}

The evaltrace environment is similar to the code environment, but by
default it uses the et font instead of tt.  Thus, it is useful for
creating evaltrace diagrams in a ``WYSIWYG'' manner.  The best way to
show how this works is by giving a few examples.

\small
\begin{verbatim}
    \begin{evaltrace}
    q-> {\tt (* 2 3)}
    |
    a-> {\tt 5}
    \end{evaltrace}
\end{verbatim}
\normalsize
 results in
\begin{evaltrace}
q-> {\tt (* 2 3)}
|
a-> {\tt 6}
\end{evaltrace}

It's a bit inconvenient to have to remember all of the character
mappings, especially for more complicated diagrams.  Thus, the
evaltrace environment defines a number of special character sequences
so that the ASCII representation of the diagrams looks more
recognizable as an evaltrace diagram.  For example:
\small
\begin{verbatim}
    \begin{evaltrace}
    +--> ;(++ 2 3)
    |
    +_-> ;5
    \end{evaltrace}
\end{verbatim}
\normalsize
 produces
\begin{evaltrace}
+--> ;(++ 2 3)
|
+_-> ;5
\end{evaltrace}
Notice that \verb'+-->' and \verb'+_->' produce upper and lower thin
arrows with elbows ({\et q->} and {\et a->}, respectively), and that
the semi-colon tells \LaTeX\ to set the rest of the line in tt font.
Notice also that since {\tt +} is now a special character (it is
actually an escape character just like \verb'\'), we must write {\tt
++} to get a plus character.

The figures at the end of this document give several more examples,
with some commentary.  Also, the distribution contains the \LaTeX\
sources for the papers on evaltrace notation so that all of the
examples in the paper can be examined.

\section{The Evaltrace Font}
\label{font}

Here are the mappings between ASCII and et characters.

\paragraph{Vertical lines.}

\begin{evaltrace}
"|" |    "*" *    "%" %    ":" :
\end{evaltrace}

\paragraph{Horizontal lines.}

\begin{evaltrace}
"-" -    "_" _    "=" =    "." .
\end{evaltrace}

\paragraph{Crossed lines.}

\begin{evaltrace}
"++" ++    "#" #    "H" H    "h" h    "x" x    "X" X    "Y" Y    "y" y
\end{evaltrace}

\paragraph{Arrow heads.}

\begin{evaltrace}
">" >    "<" <    "^" ^    "V" V    ")" )    "(" (    "~" ~    "v" v
\strut
"]" ]    "!" !
\end{evaltrace}

\paragraph{Spurred lines.}

\begin{evaltrace}
"/" /    "?" ?    "'" '
\end{evaltrace}

\paragraph{Elbows.}

\begin{evaltrace}
"q" q    "w" w    "a" a    "s" s    "Q" Q    "W" W    "A" A    "S" S
\strut
"e" e    "r" r    "d" d    "f" f    "E" E    "R" R    "D" D    "F" F
\end{evaltrace}

\paragraph{Spurred elbows.}

\begin{evaltrace}
"T" T    "t" t    "I" I
\end{evaltrace}

\paragraph{Special macros.}

The following special sequences have meaning only within an evaltrace
environment.

\begin{evaltrace}
"++-->" +-->    "++..>" +..>
\strut
"++_->" +_->    "++_.>" +_.>
\strut
"++**>" +**>    "++%%>" +%%>    "++.->" +.->
\strut
"++_*>" +_*>    "++_%>" +_%>
\end{evaltrace}

\newpage

\section{Examples}

\horizline

\small
\begin{verbatim}
  \begin{evaltrace}
  +--> ;(++ 2 3)
  |
  |  +--> ;2                  {\it First argument evaluates to itself.}
  |  |
  |  +_-> ;2
  |
  |  +--> ;3                  {\it Second argument evaluates to itself.}
  |  |
  |  +_-> ;3
  |
  +**> ;Apply ++ to 2 and 3    {\it Apply the function to its arguments.}
  *
  +_*> ;5
  \end{evaltrace}
\end{verbatim}
\normalsize
 produces
\begin{evaltrace}
+--> ;(++ 2 3)
|
|  +--> ;2                  {\it First argument evaluates to itself.}
|  |
|  +_-> ;2
|
|  +--> ;3                  {\it Second argument evaluates to itself.}
|  |
|  +_-> ;3
|
+**> ;Apply ++ to 2 and 3    {\it Apply the function to its arguments.}
*
+_*> ;5
\end{evaltrace}

Asterisks produce thick solid lines.  Notice that the semi-colon and
special {\tt +} characters don't take up any space on output, so this
affects the placement of the italicized comments in getting them to
line up correctly.

\horizline
\newpage

%%%%%%%%%%%%%%%%%%%%%

\horizline

\small
\begin{verbatim}
  \begin{evaltrace}
  +--> ;(double (++ 3 5))
  |
  |  +--> ;(++ 3 5)
  |  |
  |  +_-> ;8
  |
  +**> ;Apply DOUBLE to 8
  *    ;create local variable N with value 8
  *
  *  +--> ;(* n 2)
  *  | "n"-->"8"
  *  | "2"-->"2"
  *  +_-> ;16
  +_*> ;Result of DOUBLE is 16
  \end{evaltrace}
\end{verbatim}
\normalsize
 results in
\begin{evaltrace}
+--> ;(double (++ 3 5))
|
|  +--> ;(++ 3 5)
|  |
|  +_-> ;8
|
+**> ;Apply DOUBLE to 8
*    ;create local variable N with value 8
*
*  +--> ;(* n 2)
*  | "n"-->"8"
*  | "2"-->"2"
*  +_-> ;16
+_*> ;Result of DOUBLE is 16
\end{evaltrace}

Here, another special character, the double-quote ({\tt "}), is used
to once again produce teletype output.  Unlike, semi-colon, this each
double-quote does take up one column of space.  This is convenient in
closure diagrams, as shown in a figure below.

The sequence \verb'+**>' produces an upper thick arrow with a thin
spur, {\et T]}.

\horizline
\newpage

%%%%%%%%%%%%%%%%%%%%%

\horizline

\small
\begin{verbatim}
  \begin{evaltrace}
  +--> ;(average 3 7)
  |
  +**> ;Apply AVERAGE to 3 and 7
  *    ;create local variable X with value 3
  *    ;create local variable Y with value 7
  *
  *  +--> ;(let ((sum ...)) ...)
  *  |   +--> ;(++ x y)
  *  |   |
  *  |   +_-> ;10
  *  +%%> ;Enter LET body
  *  %    ;create local variable SUM with value 10
  *  %
  *  %  +--> ;(list x y 'average (/ sum 2))
  *  %  | "x"-->"3"
  *  %  | "y"-->"7"
  *  %  | "'average"-->"AVERAGE"
  *  %  |  +--> ;(/ sum 2)
  *  %  |  | "sum"-->"10"
  *  %  |  +_-> ;5
  *  %  +_-> ;(3 7 average 5)
  *  +_%> ;(3 7 average 5)
  +_*> ;Result of AVERAGE is (3 7 AVERAGE 5)
  \end{evaltrace}
\end{verbatim}
\normalsize
 produces
\newpage
\begin{evaltrace}
+--> ;(average 3 7)
|
+**> ;Apply AVERAGE to 3 and 7
*    ;create local variable X with value 3
*    ;create local variable Y with value 7
*
*  +--> ;(let ((sum ...)) ...)
*  |   +--> ;(++ x y)
*  |   |
*  |   +_-> ;10
*  +%%> ;Enter LET body
*  %    ;create local variable SUM with value 10
*  %
*  %  +--> ;(list x y 'average (/ sum 2))
*  %  | "x"-->"3"
*  %  | "y"-->"7"
*  %  | "'average"-->"AVERAGE"
*  %  |  +--> ;(/ sum 2)
*  %  |  | "sum"-->"10"
*  %  |  +_-> ;5
*  %  +_-> ;(3 7 average 5)
*  +_%> ;(3 7 average 5)
+_*> ;Result of AVERAGE is (3 7 AVERAGE 5)
\end{evaltrace}

\horizline
\newpage

%%%%%%%%%%%%%%%%%%%

\horizline

\small
\begin{verbatim}
  \begin{evaltrace}
  +--> ;(price-change 'widgets 1.25 1.35)
  |
  +**> ;Apply PRICE-CHANGE to WIDGETS, 1.25 and 1.35
  *    ;create local variable NAME with value WIDGETS
  *    ;create local variable OLD with value 1.25
  *    ;create local variable NEW with value 1.35
  *  +--> ;(let ...)
  *  |  +--> ;(- new old)
  *  |  | "new"-->"1.35"
  *  |  | "old"-->"1.25"
  *  |  +_-> ;0.10
  *  |
  *  |  +--> ;(/ diff old)
  *  |  |
  A_]a->+_-> ;Error!  DIFF unassigned variable.
  \end{evaltrace}
\end{verbatim}
\normalsize
 results in
\begin{evaltrace}
+--> ;(price-change 'widgets 1.25 1.35)
|
+**> ;Apply PRICE-CHANGE to WIDGETS, 1.25 and 1.35
*    ;create local variable NAME with value WIDGETS
*    ;create local variable OLD with value 1.25
*    ;create local variable NEW with value 1.35
*  +--> ;(let ...)
*  |  +--> ;(- new old)
*  |  | "new"-->"1.35"
*  |  | "old"-->"1.25"
*  |  +_-> ;0.10
*  |
*  |  +--> ;(/ diff old)
*  |  |
A_]a->+_-> ;Error!  DIFF unassigned variable.
\end{evaltrace}

Here, in order to get the bottom arrows to run into each other, we use
the raw et font character mappings.

\horizline
\newpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%

\horizline

\small
\begin{verbatim}
  \begin{evaltrace}
  +--> ;(price-change 'widgets 1.25 1.35)
  |
  +**> ;Apply PRICE-CHANGE to 1.25 and 1.35
  *    ;create local variable NAME with value WIDGETS
  *    ;create local variable OLD with value 1.25
  *    ;create local variable NEW with value 1.35
  *  +--> ;(let* ...)
  *  |  +--> ;(- new old)
  *  |  |
  *  |  +_-> ;0.10
  *  +%%> ;Enter LET body
  *  %    ;create local variable DIFF with value 0.10
  *  %  +--> ;(/ diff old)
  *  %  |
  *  %  +_-> ;0.08
  *  %  +==> ;Enter LET body
  *  %  %    ;create local variable PROPORTION with value 0.08
  *  %  %  +--> ;(* proportion 100.0)
  *  %  %  |
  *  %  %  +_-> ;8.0
  *  %  %  +==> ;Enter LET body
  *  %  %  %    ;create local variable PERCENTAGE with value 8.0
  *  %  %  %  +--> ;(list name 'changed 'by percentage 'percent)
  *  %  %  %  |
  *  %  %  %  +_-> ;(WIDGETS CHANGED BY 8.0 PERCENT)
  *  D=!D=!+_%> ;(WIDGETS CHANGED BY 8.0 PERCENT)
  +_*> ;Result of PRICE-CHANGE is (WIDGETS CHANGED BY 8.0 PERCENT)
  \end{evaltrace}
\end{verbatim}
\normalsize
 produces
\newpage
\begin{evaltrace}
+--> ;(price-change 'widgets 1.25 1.35)
|
+**> ;Apply PRICE-CHANGE to 1.25 and 1.35
*    ;create local variable NAME with value WIDGETS
*    ;create local variable OLD with value 1.25
*    ;create local variable NEW with value 1.35
*  +--> ;(let* ...)
*  |  +--> ;(- new old)
*  |  |
*  |  +_-> ;0.10
*  +%%> ;Enter LET body
*  %    ;create local variable DIFF with value 0.10
*  %  +--> ;(/ diff old)
*  %  |
*  %  +_-> ;0.08
*  %  +==> ;Enter LET body
*  %  %    ;create local variable PROPORTION with value 0.08
*  %  %  +--> ;(* proportion 100.0)
*  %  %  |
*  %  %  +_-> ;8.0
*  %  %  +==> ;Enter LET body
*  %  %  %    ;create local variable PERCENTAGE with value 8.0
*  %  %  %  +--> ;(list name 'changed 'by percentage 'percent)
*  %  %  %  |
*  %  %  %  +_-> ;(WIDGETS CHANGED BY 8.0 PERCENT)
*  D=!D=!+_%> ;(WIDGETS CHANGED BY 8.0 PERCENT)
+_*> ;Result of PRICE-CHANGE is (WIDGETS CHANGED BY 8.0 PERCENT)
\end{evaltrace}

Again, notice the use of the et font.

\horizline
\newpage

%%%%%%%%%%%%%%%%%%%%%%%

\horizline

\small
\begin{verbatim}
  \begin{evaltrace}
  +--> ;(zero-center '(3 11 13))
  |
  +**> ;Apply ZERO-CENTER to (3 11 13)
  *    ;create local variable DATA with value (3 11 13)
  *  +--> ;(let ...)
  *  | "(average data)"-->"9"
  *  +%%> ;Enter LET body
  *  %    ;create local variable AVG with value 9
  *  %  +--> ;(mapcar #'(lambda (x) (- x avg)) data)
  *  %  |  +--> ;#'(lambda (x) (- x avg))
  *  %  |  |
  *  %  |  +_-> ;#<Lexical-closure A>
  *  %  | "data"-->"(3 11 13)"
  *  %  +**> ;Apply MAPCAR to #<Lexical-closure A> and (3 11 13)
  *  %  *
  *  %  *  +==> ;Apply #<Lexical-closure A> to 3
  *  %  *  %    ;create local variable X with value 3
  *  %<----/  +--> ;(- x avg)
  *  %  *  %  |
  *  %  *  %  +_-> ;-6
  *  %  *  +_%> ;-6
  *  %  *
  *  %  *  +==> ;Apply #<Lexical-closure A> to 11
  *  %  *  %    ;create local variable X with value 11
  *  %<----/  +--> ;(- x avg)
  *  %  *  %  |
  *  %  *  %  +_-> ;2
  *  %  *  +_%> ;2
  *  %  *
  *  %  *  +==> ;Apply #<Lexical-closure A> to 13
  *  %  *  %    ;create local variable X with value 13
  *  %<----/  +--> ;(- x avg)
  *  %  *  %  |
  *  %  *  %  +_-> ;4
  *  %  *  +_%> ;4
  *  %  +_*> ;Result of MAPCAR is (-6 2 4)
  *  +_%> ;(-6 2 4)
  +_*> ;Result of ZERO-CENTER is (-6 2 4)
  \end{evaltrace}
\end{verbatim}
\normalsize
 results in
\newpage
\begin{evaltrace}
+--> ;(zero-center '(3 11 13))
|
+**> ;Apply ZERO-CENTER to (3 11 13)
*    ;create local variable DATA with value (3 11 13)
*  +--> ;(let ...)
*  | "(average data)"-->"9"
*  +%%> ;Enter LET body
*  %    ;create local variable AVG with value 9
*  %  +--> ;(mapcar #'(lambda (x) (- x avg)) data)
*  %  |  +--> ;#'(lambda (x) (- x avg))
*  %  |  |
*  %  |  +_-> ;#<Lexical-closure A>
*  %  | "data"-->"(3 11 13)"
*  %  +**> ;Apply MAPCAR to #<Lexical-closure A> and (3 11 13)
*  %  *
*  %  *  +==> ;Apply #<Lexical-closure A> to 3
*  %  *  %    ;create local variable X with value 3
*  %<----/  +--> ;(- x avg)
*  %  *  %  |
*  %  *  %  +_-> ;-6
*  %  *  +_%> ;-6
*  %  *
*  %  *  +==> ;Apply #<Lexical-closure A> to 11
*  %  *  %    ;create local variable X with value 11
*  %<----/  +--> ;(- x avg)
*  %  *  %  |
*  %  *  %  +_-> ;2
*  %  *  +_%> ;2
*  %  *
*  %  *  +==> ;Apply #<Lexical-closure A> to 13
*  %  *  %    ;create local variable X with value 13
*  %<----/  +--> ;(- x avg)
*  %  *  %  |
*  %  *  %  +_-> ;4
*  %  *  +_%> ;4
*  %  +_*> ;Result of MAPCAR is (-6 2 4)
*  +_%> ;(-6 2 4)
+_*> ;Result of ZERO-CENTER is (-6 2 4)
\end{evaltrace}

Notice the use of the special connecting-line character.

\horizline
\newpage

%%%%%%%%%%%%%%%%%%%%%%

\horizline

\small
\begin{verbatim}
  \begin{evaltrace}
                  +--> ;(zero-center '(3 11 13))
                  |
                  +**> ;Apply ZERO-CENTER to (3 11 13)
                  *    ;create local variable DATA with value (3 11 13)
                  *  +--> ;(mapcar (shifter (average data)) data)
                  *  |  +--> ;(shifter (average data))
                  *  |  | "(average data)"-->"9"
                  *  |  +**> ;Apply SHIFTER to 9
                  *  |  *    ;create local variable KONST with value 9
                  *  |  *  +--> ;#'(lambda (x) (- x konst))
        e..................'
        :         *  |  *  +_-> ;#<Lexical-closure A>
        v         *  |  +_*> ;Result of SHIFTER is #<Lexical-closure A>
  q-----------w   *  | "data"-->"(3 11 13)"
  |           |   *  +**> ;Apply MAPCAR to #<Lexical-closure A>, (3 11 13)
  |"KONST = 9"|   *  *
  |           |   *  *  +==> ;Apply #<Lexical-closure A> to 3
  a-----------s   *  *  %    ;create local variable X with value 3
        ^         *  *  %  +--> ;(- x konst)
        |         *  *  %  |
        a---------------/  +_-> ;-6
        ^         *  *  +_%> ;-6
        |         *  *
        |         *  *  +==> ;Apply #<Lexical-closure A> to 11
        |         *  *  %    ;create local variable X with value 11
        |         *  *  %  +--> ;(- x konst)
        a---------------/  |
        ^         *  *  %  +_-> ;2
        |         *  *  +_%> ;2
        |         *  *
        |         *  *  +==> ;Apply #<Lexical-closure A> to 13
        |         *  *  %    ;create local variable X with value 13
        |         *  *  %  +--> ;(- x konst)
        a---------------/  |
                  *  *  %  +_-> ;4
                  *  *  +_%> ;4
                  *  +_*> ;Result of MAPCAR is (-6 2 4)
                  +_*> ;Result of ZERO-CENTER is (-6 2 4)
  \end{evaltrace}
\end{verbatim}
\normalsize
 produces
\newpage
\begin{evaltrace}
                +--> ;(zero-center '(3 11 13))
                |
                +**> ;Apply ZERO-CENTER to (3 11 13)
                *    ;create local variable DATA with value (3 11 13)
                *  +--> ;(mapcar (shifter (average data)) data)
                *  |  +--> ;(shifter (average data))
                *  |  | "(average data)"-->"9"
                *  |  +**> ;Apply SHIFTER to 9
                *  |  *    ;create local variable KONST with value 9
                *  |  *  +--> ;#'(lambda (x) (- x konst))
      e..................'
      :         *  |  *  +_-> ;#<Lexical-closure A>
      v         *  |  +_*> ;Result of SHIFTER is #<Lexical-closure A>
q-----------w   *  | "data"-->"(3 11 13)"
|           |   *  +**> ;Apply MAPCAR to #<Lexical-closure A>, (3 11 13)
|"KONST = 9"|   *  *
|           |   *  *  +==> ;Apply #<Lexical-closure A> to 3
a-----------s   *  *  %    ;create local variable X with value 3
      ^         *  *  %  +--> ;(- x konst)
      |         *  *  %  |
      a---------------/  +_-> ;-6
      ^         *  *  +_%> ;-6
      |         *  *
      |         *  *  +==> ;Apply #<Lexical-closure A> to 11
      |         *  *  %    ;create local variable X with value 11
      |         *  *  %  +--> ;(- x konst)
      a---------------/  |
      ^         *  *  %  +_-> ;2
      |         *  *  +_%> ;2
      |         *  *
      |         *  *  +==> ;Apply #<Lexical-closure A> to 13
      |         *  *  %    ;create local variable X with value 13
      |         *  *  %  +--> ;(- x konst)
      a---------------/  |
                *  *  %  +_-> ;4
                *  *  +_%> ;4
                *  +_*> ;Result of MAPCAR is (-6 2 4)
                +_*> ;Result of ZERO-CENTER is (-6 2 4)
\end{evaltrace}

\horizline
\newpage

%%%%%%%%%%%%

\horizline

\small
\begin{verbatim}
  \begin{evaltrace}
  ;{\it the global variable A has value FOO}
  \strut
  +--> ;(test 5)
  |
  +**> ;Apply TEST to 5
  *    ;create local variable A with value 5
  *  +..> ;(simple-incf a)
  *  :  +__> ;Apply macro SIMPLE-INCF to A
  *  :  *    ;create local variable VAR with value A
  *  :  *  +--> ;(print a)
  *  :  *  | "a"-->"FOO"
  *  :  *  |      ;print FOO
  *  :  *  +_-> ;FOO
  *  :  *  +--> ;(list 'setq var (list '++ var 1))
  *  :  *  |
  *  :  *  +_-> ;(SETQ A (++ A 1))
  *  :  +_*> ;Result of macro expansion is (SETQ A (++ A 1))
  *  +.-> ;(setq a (++ a 1))
  *  | "(++ a 1)"-->"6"
  *  |     ;set local variable A to 6
  *  +_-> ;6
  +_*> ;Result of TEST is 6
  \end{evaltrace}
\end{verbatim}
 results in
\newpage
\begin{evaltrace}
;{\it the global variable A has value FOO}
\strut
+--> ;(test 5)
|
+**> ;Apply TEST to 5
*    ;create local variable A with value 5
*  +..> ;(simple-incf a)
*  :  +__> ;Apply macro SIMPLE-INCF to A
*  :  *    ;create local variable VAR with value A
*  :  *  +--> ;(print a)
*  :  *  | "a"-->"FOO"
*  :  *  |      ;print FOO
*  :  *  +_-> ;FOO
*  :  *  +--> ;(list 'setq var (list '++ var 1))
*  :  *  |
*  :  *  +_-> ;(SETQ A (++ A 1))
*  :  +_*> ;Result of macro expansion is (SETQ A (++ A 1))
*  +.-> ;(setq a (++ a 1))
*  | "(++ a 1)"-->"6"
*  |     ;set local variable A to 6
*  +_-> ;6
+_*> ;Result of TEST is 6
\end{evaltrace}

\horizline
